//
//  main.m
//  第一节课-4-5 OC
//
//  Created by 钟纪旺 on 16/4/5.
//  Copyright © 2016年 zjw. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Atom.h"
#import "People.h"
#import "Mouse.h"
int main(int argc, const char * argv[]) {
    @autoreleasepool {
//        Atom *atom=[[Atom alloc] init];
//        NSLog(@"Atom chemical element name:%@",atom.chemicalElement);
//      //  NSLog(@"Atom chemical element name:%@",[atom chemicalElement]);
         NSLog(@"Hello, World!");
        People *p =[[People alloc]init];
    
    p.name = @"小鸭子";
//    Animal *ani = p;
//    
//    [ani eat];
//    [ani sleep];
//    
//    [p eat];
//    [p sleep];
//    [p talk:@"我饿了"];
//}
        Mouse *m =[[Mouse alloc]init];
        m.name=@"米老鼠";
        
        NSArray *arr=@[p,m];
        for (int i=0; i<arr.count; i++) {
            Animal *ani =arr[i];
            [ani eat];
            [ani sleep];
        }
    }
    return 0;
}

